
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu 
 * @Date : 2023/5/17 16:27
 */

#include "iostream"
#include "algorithm"

using namespace std;

struct point {
    int id;
    int x;
    int y;
    int dis;
};

bool cmp(point a, point b) {
    return a.dis == b.dis ? a.id < b.id : a.dis < b.dis;
}

int main() {
    int n, X, Y;
    scanf("%d %d %d", &n, &X, &Y);

    point points[n];
    for (int i = 0; i < n; ++i) {
        points[i].id = i + 1;
        scanf("%d %d", &points[i].x, &points[i].y);
        points[i].dis = (points[i].x - X) * (points[i].x - X) + (points[i].y - Y) * (points[i].y - Y);
    }

    sort(points, points + n, cmp);

    for (int i = 0; i < 3; ++i) {
        cout << points[i].id << endl;
    }

    return 0;
}